package com.techysky.service;



import java.util.List;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import com.techysky.entity.QuestionPaper;
import com.techysky.repository.QuestionPaperRepository;

@Service
public class QuestionPaperService {
	@Resource
	private QuestionPaperRepository questionPaperRepository;
	//保存数据
	@Transactional
	public void save(QuestionPaper questionPaper){
		questionPaperRepository.save(questionPaper);
	}
	@Transactional
	public void deleteAll(String ids){
		String[]  strs=ids.split(",");
		for(int i=0,len=strs.length;i<len;i++){
			questionPaperRepository.delete(strs[i]);
		}
	}
	@Transactional
	public List<QuestionPaper> findByPaperId(String paperId){
		return questionPaperRepository.findByPaperId(paperId);
	}
}
